perm filename TECO.MRC[UP,DOC]1 blob sn#348665 filedate 1978-04-20 generic text, type T, neo UTF8
		The XTEC manual


		Mark R. Crispin

	XTEC (acronym for "eXperimental TECo") is a TECO command
language compiler.  XTEC is based on the Stevens Institute of
Technology changes to Digital Equipment Corporation's standard TECO,
but is a total rewrite of TECO.  The initial programming on XTEC was
done by Jack W. Krupansky; later work, by Mark R. Crispin.

Command	Syntax			Usage
---------------------------------------------------------------------

↑@				ignored on input; illegal command

↑A	↑A...text...↑A		type out the text inside the ↑A's

↑B				illegal command

↑C	↑C			return to monitor without closing
				files or processing any "ED"

↑D				enter DDT if a DEC DDT is present, other-
				wise an illegal command

↑E	↑E=			the value of the form-feed flag,
				-1 if a form-feed seen
	↑Ex			in a search, match with any character
				of type x:
				A	any alphabetic character
				D	any digit
				L	any end of line character or
					end of buffer
				S	any string of spaces or tabs
				V	any lower case alphabetic
				W	any upper case alphabetic
				<nnn>	ascii character whose octal
					value is nnn
				[a,b,c...] any one of the characters
					a,b,c...

↑F	↑F=			the value of the console switches
	n↑F=			the value of the universal I/O
				index of the teletype belonging to
				job n(i.e. tty+↑O200000)

↑G	↑G=			returns job number
	n↑G=			returns contents of monitor location
				n(i.e. does a PEEK UUO)  DEC version only.
	m,n↑G=			returns result of GETTAB UUO on m,n
	↑G↑G			on input cancels command
	↑G<space>		on input retypes current line

↑H	↑H=			time of day in jiffies(a jiffy is
				1/60 sec in USA, 1/50 where 50Hz power
				is used(i.e. Europe))

↑I	↑I...text...<alt>	inserts a tab and following text up to
				the altmode(i.e. is the same as an
				i<tab>...text...<alt>)

↑J				ignored on input except in text 
				strings; "line-feed"

↑K				ignored on input except in text
				strings; "vertical tab"

↑L	↑L			inserts a "form-feed", defines end of
				page

↑M				ignored on input except in text
				strings; "carriage return"

↑N	↑N=			the value of the end of file flag,
				-1 if an end of file seen
	↑Nx			in a search, accept any character
				except x

↑O	↑On			accept the next numeric value as octal

↑P	↑P=			the number of form-feeds seen(i.e.
				the page number)
	n↑P			go to page n

↑Q	↑Qx			in text, accept the next character
				literally

↑R	↑Rx			same as ↑Q

↑S	↑S			in a search, accept any separator
				character in this position

↑T	↑T=			accept a single character from the
				tty, return the value
	:m,n↑T=			do a TTCALL n,m; return any value.
				Special cases:
				:8↑T=	does a "RESCAN 1" UUO, and
					return a -1 if there was a
					command to rescan.
				:1,8↑T=	return the value of the "CCL
					flag", which is -1 if XTEC
					was called at CCL entry point

↑U	n↑U			does a USETI(.ACCES) on the input file to
				block n
	↑U			on input cancels line

↑V	↑V			set prevailing case for all text to
				lower case(0↑V removes conversion)
	↑V			in text sets prevailing case for the
				next character to lower case
	↑V↑V			in text sets prevailing case for that
				text to lower case

↑W	↑W			set prevailing case for all text to
				upper case(0↑W removes conversion)
	↑W			in text sets prevailing case for the
				next character to upper case
	↑W↑W			in text sets prevailing case for that
				text to upper case

↑X	↑X=			return value of search mode flag(-1
				means exact, 0 means either case)
	n↑X			set value of search mode flag to n
	↑X			in a search, accept any character as
				a match

↑Y	↑Y=			returns number of form feeds seen(same
				as ↑P=)
	n↑Y			yanks to page n, i.e. goes to page n
				without preserving current pages

↑Z	↑Z			closes files and returns to the
				monitor, or to the appropriate "ED"
				program

<alt>	<alt>			functions as a text terminator, a
				command delimiter.
	<alt><alt>		on input tells XTEC to start the
				execution of the command

↑\				illegal command

↑]				illegal command

↑↑	↑↑X			return the ASCII value of the
				character x
	↑↑X			in text, translate the characters
				@,[,\,],↑,← to "lower case"

↑←				illegal command

<space>	<space>			ignored on input except in text
				strings
	m<space>n=		returns m+n

!	!...tag...!		specifies a tag(either a comment or
				a label to be branched to)

"	n"x...commands...'	open a conditional.  The commands are
				executed if the value n comforms with
				the condition x:
				G	n>0
				L	n<0
				E	n=0
				N	n<>0
				C	n is an ASCII symbol character
				D	n is an ASCII digit
				A	n is an ASCII alphabetic
				V	n is ASCII lower case
				W	n is ASCII upper case
				T	"True" n<0
				F	"False" n=0
				S	"Succeed" n<0
				U	"Unsuccessful" n=0

#	m#n=			return bitwise OR of m,n

$				illegal command

%	%x=			increment numeric Q-register x by 1,
				return value

&	m&n=			return bitwise AND of m,n

'				terminate a conditional(see ")

(	(expression)		open an expression
	(Q-register name)	open a multi-letter Q-register name.

)				close an expression or Q-register name

*	m*n=			return value of m times n
	*x			insert last command in Q-register x

+	m+n=			return value of m plus n

,	m,n			used to delimit two arguments to a
				command

-	m-n			return value of m minus n
	-x			where x is a command that takes a
				numeric argument, same as -1x

.	.=			returns the value of the buffer
				pointer

/	m/n			return value of m divided by n
	/			after an error, gives more details on
				what happened

0,1,2,3,4,5,6,7,8,9		numbers

:	:x			where x is almost any command, if the
				command x fails, then it will return
				a zero instead of issuing an error
				message.  If it succeeds, it will
				return a -1.

;	;			in an iteration, if the last command
				failed, leave the iteration; otherwise
				continue.  Illegal if not in an
				iteration

<	n<commands>		open an iteration.  execute the
				commands n times(default is infinity)

=	n=			type out n in decimal
	n==			type out n in octal
	m,n=	or m,n==	type out n in decimal(octal), then
				output, depending on m:
				m<0	cr/lf
				m=0	nothing
				m>0	ASCII character whose value
					is n

>				close an iteration

?	?			enter(or leave if in) trace mode.
				All commands are typed out as they
				are executed
	?			after an error, type the last 10
				commands executed(the last one is the
				one that caused the error)

@	@x			where x is a text command, causes
				the character following the command
				to be a delimiter character for the
				text(in lieu of altmode)

A	A			append the next page to the editing
				buffer
	nA=			returns the ASCII value of the next
				nth character in the buffer

B	B=			returns a zero(beginning of buffer)

C	nC			moves the buffer pointer n characters

D	nD			deletes n characters

E	Ex			execute one of the series of "E"
				commands:
				(Note:  For a filespec, the following
					are legal switches:
				/APPEND	(log files) append to current
					log file, if any
				/ASCII	file is ASCII, no LSN's
				/GENLSN	generate LSN's
				/LSN	file may have LSN's(default)
				/NOIN	(log files) do not include
					typein in log file
				/NONSTD	open DECtape in non-standard
					mode(DEC version only)
				/NOOUT	(log files) do not include
					typeout in log file
				/OCTAL	file is octal
				/PROTECT:nnn	file protection is to
					be nnn(DEC version only)
				/SIXBIT	file is SIXBIT
				/SUPLSN	suppress LSN's if any

		EA<filespec>	("Edit Append")append to file

		EB<filespec>	("Edit Backup")when editing file,
				rename original file to have extension
				.BAK(to have a backup)

		EC=		("Edit Core")do a garbage collection,
				shrink core if possible, and return
				number of words used
		nEC		do a garbage collection, and change
				core allocation to n words if possible

		nED<filespec>	("Edit Do")run the program specified
				at offset n when leaving XTEC

		EF		("End File")finish off output file

		EG		("Edit Go")do an EX, but run COMPIL
				to compile program

		EH=		("Edit Help")return value of EH flag,
				the error message verbosity level.
				1:=code only; 2:=one line; 3:=full message
		nEH		set EH value to n

		<args>EI<filespec> ("Edit Indirect")execute XTEC
				macro.  Args are passed to macro.
				This is the normal way to execute an
				XTEC program

		EL<filespec>	("Edit Log")open up a log file
		nEL		modify what goes into log file:
				0:=nothing; 1:=output; 2:=input,
				3:=everything

		nEM		("Edit Magtape")do magtape operation n

		EN<filespec>	("Edit Name")rename file(no name
				deletes file)

		EO=		("Edit Old")returns value of "edit
				old" flag(to enable old features);
				Currently, the only value is 0.
		nEO		set "EO flag" to n

		EP<filespec>	("Edit Put")place file into Q-register
				"*"(special-purpose Q-register)

		ER<filespec>	("Edit Read")open file for input

		ES=		("Edit Search")return value of "ES"
				flag; negative means autotypeout on,
				zero means autotypeout off, positive
				means autotypeout with value used as
				ASCII character indicating buffer
				pointer position
		nES		set "ES flag" to n

		ET=		("Edit Typeout")returns value of "ET"
				flag; 0 means translate control chars
				and altmode, -1 means literal typeout
		nET		set "ET" flag to n

		EU=		("Edit Uppercase")returns value of
				"EU" flag; -1 means no case flagging,
				0 means lower case flagging, 1 means
				upper case flagging

		EW<filespec>	("Edit Write")open file for output

		EX		("EXit")terminate editing, standard
				way of getting out of XTEC

		nEY		("Edit Yank")same as Y command, but
				legal from tty command level

		EZ<filespec>	("Edit Zero")zero DECtape directory
				and do an edit write

F	Fx			execute one of the series of "F"
				series commands:

		<args>FD...text...<alt>
				("Find and Destroy")search for the text
				specified(S-type), and destroy everything
				up to it.  If the search is forwards, also
				destroy the string.  This is similar to:
				.UA<args>S...text...<alt>QA,.K

		<args>FN...text1...<alt>...text2...<alt>
				do an "N" search for ...text1..., and
				replace it with ...text2...

		<args>FS...text1...<alt>...text2...<alt>
				same as "FN", only using an "S" search

G	Gx			fetch contents of Q-register x, and
				insert it in the editing buffer

H	H=			same as B,Z=

I	I...text...<alt>	insert text in the editing buffer
	nI<alt>			insert character which has value n
				in the editing buffer

J	nJ			set the value of . to n

K	nK			kill n lines
	m,nK			kill the text from m to n

L	nL			move the pointer n lines

M	<args>Mx		execute macro in Q-register x, passing
				any arguments

N	<args>N...text...<alt>	search from the current position in
				editing buffer to the end of file for
				the text; if the search fails, the
				buffer is left empty

O	O...tag...<alt>		go to tag

P	nP			get the next page(if n specified, do
				it n times), output old page
	m,nP			output characters in position m
				through n to file, but do no paging
	nPW			output page, but do not get a new page
				(this is same as HP).  If n is
				specified, do it n times
	m,nPW			same as m,nP

Q	Qx=			return value of numeric Q-register x;
				if alphanumeric, if there is an equals
				sign after the Q-register name, type
				out the contents of the Q-register,
				otherwise, an error(crock, crock)

R	nR			move the pointer back n characters
				(same as -nC)

S	<args>S...text...<alt>	search for the text.  If the search
				fails, leave the pointer unchanged.
				If there are any arguments, these
				specify boundaries(also allow you to
				do backward searches).  This also
				works with FD, FN, FS, and N

T	nT			type n lines
	m,nT			type from position m to position n

U	nUx			save numeric value n into Q-register x

V				illegal command

W				illegal command

X	nXx			store n lines in Q-register x
	m,nXx			store from position m to position n in
				in Q-register x

Y	nY			(only legal in macros) destory current
				contents of editing buffer, yank in
				new page.  If n is specified, do it
				n times(use EY from terminal)

Z	Z=			return the number of characters in the
				buffer, i.e. the position of the last
				character in the buffer

[	[x			"push" Q-register x; save it on the
				Q-register pushdown list

\	\=			return a value from a digit string
				immediately at the text pointer
	n\			insert ASCII representation of the
				number; 123\ inserts "123" as text

]	]x			"pop" Q-register x; restore it from
				the Q-register pushdown list

↑	↑x			in a command, take the next character
				and make it a control character

←	←...text...<alt>	search for ...text..., like an "N"
				search that "Y"'s instead of "P"'s

<rubout>			on input, deletes the last character


	Default initialization commands may be utilized in one of
two ways.  The first is to have a file called XTEC.INI.  This file
is EI'd every time XTEC is run.  The second way is to have an XTEC
entry in a SWITCH.INI parameter file.